package com.com.util;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * Created by pankaj on 7/20/14.
 */
public class Sorter<T extends Comparable<? super T>> {

    List<T> backedCollection = new ArrayList<T>();

     public void add(Collection<? extends T> data){
         for(T t : data){
            backedCollection.add(t);
         }
     }

    public void results(Collection<? super T> result){
        for(T t : backedCollection){
            result.add(t);
        }
    }

    public void sort(){
        Collections.sort(backedCollection);
    }
}
